-
-
Notifications
You must be signed in to change notification settings - Fork 241
feat: NS 4.0 Integration #1250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: NS 4.0 Integration #1250
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f5f6543
to
20f6a90
Compare
test |
f74be62
to
1808866
Compare
Angular application is started with `application.run()` which means the the root view of the app will be the root view of the `AppComponent`. Previous behavior: Anagular application was started with `application.start()` - this aways creates a root `Frame`. The platfrom bootstrap was always creating the inital `Page` and loading the `AppComponent` inside. The `<page-router-outlet>` will create a Frame as a native element and will create a page for each component activated in it (including the inital page).
…improved relative url handling
Add `tsc-w` script to plugin's `package.json` file.
Rename RootView class to AppHostView class. Expose ngAppRoot property of AppHostView class. Add modal-nested-test example.
test |
cca244f
to
1d7237a
Compare
test |
test |
2 similar comments
test |
test |
SvetoslavTsenov
approved these changes
Mar 29, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bootstrap and Navigation
NativeScript 4.0 allows you to put any view as the root(not only Frame) of the application. To support in angular projects we had to introduce some changes in how A{N}gular apps are bootstrapped.
Previous Behavior
Bootstrap creates a root
Frame
and initialPage
. Then it bootstraps the angular application inside this page. Navigation with<page-router-outlet>
will always navigate in theFrame
created by the bootstrap.Limitations:
RadSideDrawer
for example). It is always theFrame
created by the bootstrap.<page-router-outlet>
as there is only oneFrame
.Page
view wrapping your components and you can always. Because theActionBar
is part of thatPage
you can always change it with the<ActionBar>
component.New Behavior
Bootstrap will not create root view by default. It will use the root view of your main application component as the root view of the application. The
<page-router-outlet>
component will create its ownFrame
and will use it for navigation. It will also wrap the components you navigate to in aPage
and will navigate to it as it did before.Which means:
You can use any view for application root. Finally, you can have application-wide
RadSideDrawer
.You have more flexibility over where to place the
<page-router-outlet>
, you can even have more than one for more advanced scenarios.If you don't use
<page-router-outlet>
in your app you will not get the defaultPage
andFrame
, which means you will not be able to inject them in you components or show theActionBar
. There is specialcreateFrameOnBootstrap
option you can pass on bootstrap to make things as before:<page-router-outlet>
you probably don't have to do any changes. Bootstrap will not createFrame
andPage
, but the outlet will do that. It will also take care of providingPage
and so theActionBar
should work as before.Working with Frames
There might be multiple frames (if you have multiple
<page-router-outlet>
's). Angular DI works with singletons, so it will always return one instance ofFrame
. We have introducedFrameService
(still experimental) which has agetFrame()
method. It will return the current frame (the one you have navigated last).